package de.eves.hibernate;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.*;

public class InitSessionFactory {
	/** The single instance of hibernate SessionFactory */
	private static SessionFactory sessionFactory;

	private InitSessionFactory() {
	}

	static {
		try {
			sessionFactory = new AnnotationConfiguration().configure()
					.buildSessionFactory();
		} catch (Throwable ex) {
			throw new ExceptionInInitializerError(ex);
		}
	}

	public static SessionFactory getInstance() {
		return sessionFactory;
	}
}